"""
LESSON 09. CONCATENATION.
"""


S = r"C:/HOME/DC/" #road-yo'l
print(S)

R = 'Py'+'thon' #konkatinatsiya
print(R)

S1 = 'Hello, '
S2 = 'world !'
S3 = S1 + S2 #konkatinatsiya

print(S3)

NAME = 'John'
AGE = 20

print('Mening ismim ' + NAME + ". Men " + str(AGE))

print('Salom ' * 5)

T = 'Hello world!'
print(T[0]) # Tni 0-si H
print(T[-12]) # Tni -12-si H

# +---+---+---+---+---+---+---+---+---+---+---+---+
# | H | e | l | l | o |   | w | o | r | l | d | ! |
# +---+---+---+---+---+---+---+---+---+---+---+---+
# 0   1   2   3   4   5   6   7   8   9  10  11  12
# -12 -11 -10 -9  -8  -7  -6  -5  -4  -3  -2 -1

#[X:Y:Z]

S = 'Hello world!'

print(S[0:12]) #Hello world! 0dan 12-oraliqni chop et.
print(S[-1]) #! 0dan -1gacha oraliqni chop et.
print(S[0:5]) #Hello 0dan 5-oraliqni chop et.
print(S[:5]) #Hello 0dan  5-oraliqni chop et.
print(S[6:]) #world! 6dan oxirigacha chop et.
print(S[::2]) #Hlowrd Boshidan oxirigacha 2tadan chop et.
print(S[::-1]) #!dlrow olleH oxiridan boshigacha 1tadan chop et.
print(S[:5] + S[8:]) #Hellorld! Boshidan 5gacha 8dan oxirigacha chop et.
